// http protocol, uses for Http protocol functions.
//
#pragma once
#include "HttpStream.h"

namespace HttpProtocol
{

class CHttpSession;

class CHttpConnect
{
public:
	CHttpConnect(CHttpSession* pSession, LPCSTR pstrServer,
		DWORD dwFlags,
		INTERNET_PORT nPort = INTERNET_INVALID_PORT_NUMBER,
		LPCSTR pstrUserName = NULL, LPCSTR pstrPassword = NULL,
		DWORD_PTR dwContext = 1);
	~CHttpConnect(void);

public:
	CHttpStream* OpenRequest(LPCSTR pstrVerb,    LPCSTR pstrObjectName,
		LPCSTR pstrReferer = NULL,DWORD_PTR dwContext = 1,
		LPCSTR* ppstrAcceptTypes = NULL, LPCSTR pstrVersion = NULL,
		DWORD dwFlags = INTERNET_FLAG_EXISTING_CONNECT);

	BOOL Release(void);

private:
	HINTERNET m_hConnection;
};

}